package com.xzh.springCloud.service;

import com.xzh.springCloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author: zhiHong
 * @CreateTime: 2023-08-31 10:03
 * @Description: service层
 */
@FeignClient(value = "member-service-nacos-provider", fallback = MemberFallbackService.class)
public interface MemberOpenFeignService {
    /**
     * 远程调用方式是 get 方法，远程调用的 url 是 http://member-service-nacos-provider/member/get/{id}
     * member-service-nacos-provider 是 nacos 注册中心服务名
     * openfeign 会根据负载均衡算法来决定调用的使 10004 还是 10006
     */
    @GetMapping(value = "/member/get/{id}")
    public Result queryMemberById(@PathVariable("id") Long id);
}
